<?php


namespace App\Common\Tools;


class Tools
{
    public static function unset(array $fields, array &$arr)
    {
        foreach ($fields as $field) {
            if (isset($arr[$field])) {
                unset($arr[$field]);
            }
        }
    }

    public static function itemsInArray(array $array, array &$items)
    {
        foreach ($items as $k => $item) {
            if (!in_array($item, $array)) {
                unset($items[$k]);
            }
        }
    }
}